If you have ever been annoyed at having to reach for the mouse to respond to the “Replace existing fubar?” dialog, here are some ways to fix it with ResEdit. Before giving the recipes, I should mention that responsible experts always say that you should only use ResEdit on a ~copy~ of your System file, not the one that is in use. Don’t say you weren’t warned.
System 6
--------
Open the ALRT -3996 resource in the System. Select “Set 'ALRT' Stage Info…” from the menu. In the resulting dialog box, change the radio buttons to indicate that Cancel, rather than OK, is the default button at each stage.
System 7.0, 7.0.1
-----------------
For our first hack, we have a way to make Replace rather than Cancel be the default button. Edit the PACK 3 resource. ResEdit will warn you that this resource is compressed and editing it will decompress it, but never mind that. Normally you will get the hex editor, but if you happen to have the CODE editor installed in your copy of ResEdit, you may have to open the hex editor manually. Anyway, find offset 202C, and change 670A to 670C. (If what you see at offset 202C is not 670A, all bets are off.) Close the System and save changes.
Second, there is a hack by Elizabeth Wylie that leaves the buttons alone, but lets you Save with the option key pressed and replace the existing file without even seeing the dialog. Open the PACK 3 resource with the hex editor. At offset 9EC, change 6100 16B0 to 6100 2B2A. At the end of the resource, append:
1038 017B 0800 0002
6700 0006 7001 4E75
6100 EB74 4E75
Close and save changes.
Finally, you could use both hacks.
System 7.1
----------
The idea is the same as for 7.0, but the addresses change.
For the default button hack, at the address 2104 change 670A to 670C.
For the option key hack, at address A36 change 6100 173E to 6100 2BDE, and append
1038 017B 0800 0002
6700 0006 7001 4E75
6100 EB4E 4E75.
What Was Wrong With Previous Versions
-------------------------------------
The way the replace warning normally works is that the cancel button is the default button, so both command-period and return press the cancel button. Previous versions of my hack essentially switched the buttons. Then the return key activates the replace button, ~but so does command-period~. That could have unfortunate consequences. There’s also the fact that the older versions required changing a DITL resource, while this version changes only PACK 3.
Technical Information
---------------------
For programmers, here’s the disassembly of the PACK 3 hacks. The default button hack replaces
BEQ.S *+$000C
with
BEQ.S *+$000E
This skips an instruction that sets the cancel button as the default.